<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>入库申请查询（根据id）</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/bootstraptable/bootstrap-table.css" rel="stylesheet">
    <style>
        .text_no_border{
            border: none;
        }
    </style>
</head>
<body>

<div style="color: #0e9aef;margin: 20px;">您正在做的业务是：库存管理--入库申请管理--入库申请查询</div>
<div class="container">
    <form class="form-horizontal" id="inbound_request_review_byId_form">
        <div>
            申请单编号：<span id="gatherId"></span> 其中审核状态：<span id="checkTag"></span>
            <button type="button" class="btn btn-default col-md-offset-8" onclick="javascript:history.back()">返回</button>
        </div>
        <div class="panel panel-default" style="margin-top: 5px;">
            <div class="page-heading">
                <div class="panel-title">
                    <h2 style="text-align: center;">入库申请单</h2>
                </div>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">入库人：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="storer" id="storer" />
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">入库理由：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="reason" id="reason" />
                        </div>
                    </div>
                </div>
                <!--入库明细-->
                <table style="margin-top: 20px;" class="table table-bordered table-striped" data-toggle="table" id="inbound_request_review_byId_table">
                    <thead>
                    <th data-field="id">序号</th>
                    <th data-field="productName">商品名称</th>
                    <th data-field="productId">商品编号</th>
                    <th data-field="productDescribe">描述</th>
                    <th data-field="amount">数量</th>
                    <th data-field="amountUnit">单位</th>
                    <th data-field="costPrice">成本单价（元）</th>
                    <th data-field="subtotal">小计（元）</th>
                    </thead>
                </table>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">总件数：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="amountSum" id="amountSum" />
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">总金额：</label>
                        <div class="col-md-8">
                            <input type="text" readonly class="form-control text_no_border"
                                   style="background-color: white" name="costPriceSum" id="costPriceSum" />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">登记人：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" readonly
                                   style="border: none;background-color: white" name="register" id="register" />
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">登记时间：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control text_no_border" readonly
                                   style="background-color: white" name="registerTime" id="registerTime" />
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">审核人：</label>
                        <div class="col-md-8">
                            <input class="form-control" type="text" readonly
                                   style="background-color: white;border: none;background-color: white"
                                   name="checker" id="checker">
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="col-md-4 control-label">审核时间：</label>
                        <div class="col-md-8">
                            <input class="form-control" type="text" readonly
                                   style="background-color: white;border: none;" name="checkTime" id="checkTime">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">备注：</label>
                        <div class="col-md-8">
                            <textarea class="form-control" style="resize: none" rows="2" cols="50"
                                      name="remark" id="remark">

                            </textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </form>
</div>





<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="/js/hAdmin.js?v=4.1.0"></script>
<script src="/js/currentTime.js"></script>

<!-- 第三方插件 -->
<script src="/js/plugins/pace/pace.min.js"></script>

<!--BootstrapTable-->
<script src="/bootstraptable/bootstrap-table.min.js"></script>
<script src="/bootstraptable/locale/bootstrap-table-zh-CN.min.js"></script>

<script>
    $(function (){
        let id=localStorage.getItem("id")
        $.post("/storage/gather/getByIdStorage",{"id":id},function (res){
            if(res.checkTag=="S001-0"){
                $("#inbound_request_review_byId_form #gatherId").html(res.gatherId).css("color","#eea236")
                $("#inbound_request_review_byId_form #checkTag").html("等待").css("color","#eea236")
            }else if(res.checkTag=="S001-1"){
                $("#inbound_request_review_byId_form #gatherId").html(res.gatherId).css("color","green")
                $("#inbound_request_review_byId_form #checkTag").html("通过").css("color","green")
            }else {
                $("#inbound_request_review_byId_form #gatherId").html(res.gatherId).css("color","red")
                $("#inbound_request_review_byId_form #checkTag").html("未通过").css("color","red")
            }

            $("#inbound_request_review_byId_form #id").val(res.id)
            $("#inbound_request_review_byId_form #storer").val(res.storer)
            $("#inbound_request_review_byId_form #amountSum").val(res.amountSum)
            $("#inbound_request_review_byId_form #costPriceSum").val(res.costPriceSum)
            $("#inbound_request_review_byId_form #remark").val(res.remark)
            $("#inbound_request_review_byId_form #checker").val(res.checker)
            $("#inbound_request_review_byId_form #register").val(res.register)
            $("#inbound_request_review_byId_form #registerTime").val(formater(res.registerTime))
            $("#inbound_request_review_byId_form #checkTime").val(formater(res.checkTime))
            if(res.reason=="R001-1"){
                $("#inbound_request_review_byId_form #reason").val("生产入库")
            }else if (res.reason=="R001-2"){
                $("#inbound_request_review_byId_form #reason").val("库存初始")
            }else if (res.reason=="R001-3"){
                $("#inbound_request_review_byId_form #reason").val("赠送")
            }else if (res.reason=="R001-4"){
                $("#inbound_request_review_byId_form #reason").val("内部归还")
            }else {
                $("#inbound_request_review_byId_form #reason").val("其他归还")
            }


        })
        $.post("/storage/gather/getIdStorageDetails",{"id":id},function (res) {
            for(let i=0;i<res.length;i++){
                $("#inbound_request_review_byId_table").bootstrapTable("append",res[i])
            }
        })
    })
</script>
</body>
</html>